<?php

namespace App\Policies;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class FactoryStatisticalPolicy
{
    use HandlesAuthorization;
    public function viewAny(User $user){
        $role = $user->role;
        return $role->code == 'ADMIN' || $role->code == 'FACTORY' ? self::allow() : self::deny('没有权限访问');;
    }
}
